package com.yanqu.road.entity.player;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

@FieldTypeAnnotation(tableName = "t_s_open_invited_data")
public class OpenInvitedData extends DataObject {

    @FieldTypeAnnotation(desc = "玩家openId", select = true, update = true)
    private String openId = "";
    @FieldTypeAnnotation(desc = "邀请该玩家的邀请码")
    private String invitedCode = "";
    @FieldTypeAnnotation(desc = "注册时间")
    private long registerTime;

    public OpenInvitedData() {
    }

    public OpenInvitedData(String openId, String invitedCode, long registerTime) {
        this.openId = openId;
        this.invitedCode = invitedCode;
        this.registerTime = registerTime;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        if (openId == null) {
            return;
        }
        if (this.openId == null || !this.openId.equals(openId)) {
            this.openId = openId;
            setOp(DataStatus.Update);
        }
    }

    public String getInvitedCode() {
        return invitedCode;
    }

    public void setInvitedCode(String invitedCode) {
        if (invitedCode == null) {
            return;
        }
        if (this.invitedCode == null || !this.invitedCode.equals(invitedCode)) {
            this.invitedCode = invitedCode;
            setOp(DataStatus.Update);
        }
    }

    public long getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(long registerTime) {
        if (this.registerTime != registerTime) {
            this.registerTime = registerTime;
            setOp(DataStatus.Update);
        }
    }
}
